package base;

public class MaxRepetations {

	
	public static void main(String[] args) {
		int a[]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,3,3,3,3,3,4,4,4,4,4,4,4,5};
		maxRep(a);
	}
	public static void maxRep(int[] a){
		int maxcount =1;
		int count =1;
		for(int i=0;i<a.length;i++){
			if(i!=a.length-1){
				if(a[i]==a[i+1]){
					count++;
				}else{
					if(count>maxcount){
						maxcount = count;
						count = 0;
					}else{
						count =0;
					}
				}
			}
		}
		System.out.println("Max Count "+maxcount);
	}

}
